package com.theunderminejournal.updater;

import javax.swing.JFrame;

import com.theunderminejournal.updater.gui.TUJGUI;

/**
 * 
 * 
 */
public class App {
	
	public static void main(String[] args) {		

		App app = new App();
		
		final TUJMarketDataThread mthread = new TUJMarketDataThread(app.loadGUI());
		
		Thread thread = new Thread(mthread);
		
		Runtime.getRuntime().addShutdownHook(new Thread(){
			public void run(){
				mthread.setRunning(false);
			}
		});
		
		
		//Start background thread
		thread.start();
		
	}
	
	protected TUJGUI loadGUI(){
		TUJGUI frame = new TUJGUI();
				
		frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
		frame.setResizable(false);

		// Display the window.
		frame.pack();
		frame.setVisible(true);

		return frame;
	}
	


}
